<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "b_course_info".
 *
 * @property string $id
 * @property string $name 课程名称
 * @property string $content 简介
 * @property string $course_type 类型
 * @property string $short_title 简称
 * @property string $course_code 代号
 * @property string $course_keyword 标签
 * @property string $course_level 课程级别（初中高）
 * @property string $base_knowledge 基础知识
 * @property string $study_plan 学习安排
 * @property string $study_require 学习要求
 * @property string $exam_plan 考试安排
 * @property string $course_lang 使用语言
 * @property string $is_exam 是否有考核标准（0否1是）
 * @property int $image 课程图片
 * @property string $image_url 课程图片url
 * @property string $course_visibility 可见性
 * @property string $course_status 状态
 * @property string $course_publish 发布时间
 * @property double $total_hour 总学时
 * @property string $school 学校
 * @property string $school_name 学校名称
 * @property string $major_id
 * @property string $major_name 专业名称
 * @property string $price 价格
 * @property int $discount_cent 折扣
 * @property int $course_source_from 课程来源
 * @property string $course_tier 课程层级
 * @property int $is_public
 * @property int $is_examine
 * @property string $create_by
 * @property string $create_time
 * @property string $update_by
 * @property string $update_time
 * @property int $del_flag
 * @property string $project_id
 */
class BCourseInfo extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'b_course_info';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id', 'name', 'course_type', 'is_exam', 'course_visibility', 'course_status', 'school_name', 'major_name', 'create_time'], 'required'],
            [['image', 'discount_cent', 'course_source_from', 'is_public', 'is_examine', 'del_flag'], 'integer'],
            [['course_publish', 'create_time', 'update_time'], 'safe'],
            [['total_hour', 'price'], 'number'],
            [['id', 'school', 'major_id', 'create_by', 'update_by', 'project_id'], 'string', 'max' => 36],
            [['name', 'course_type', 'short_title', 'course_code', 'course_keyword', 'course_level', 'base_knowledge', 'course_lang', 'is_exam', 'image_url', 'course_visibility', 'course_status', 'school_name', 'major_name', 'course_tier'], 'string', 'max' => 255],
            [['content', 'study_plan', 'study_require', 'exam_plan'], 'string', 'max' => 2048],
            [['project_id'], 'string', 'max' => 36],
            [['id'], 'unique'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'name' => 'Name',
            'content' => 'Content',
            'course_type' => 'Course Type',
            'short_title' => 'Short Title',
            'course_code' => 'Course Code',
            'course_keyword' => 'Course Keyword',
            'course_level' => 'Course Level',
            'base_knowledge' => 'Base Knowledge',
            'study_plan' => 'Study Plan',
            'study_require' => 'Study Require',
            'exam_plan' => 'Exam Plan',
            'course_lang' => 'Course Lang',
            'is_exam' => 'Is Exam',
            'image' => 'Image',
            'image_url' => 'Image Url',
            'course_visibility' => 'Course Visibility',
            'course_status' => 'Course Status',
            'course_publish' => 'Course Publish',
            'total_hour' => 'Total Hour',
            'school' => 'School',
            'school_name' => 'School Name',
            'major_id' => 'Major ID',
            'major_name' => 'Major Name',
            'price' => 'Price',
            'discount_cent' => 'Discount Cent',
            'course_source_from' => 'Course Source From',
            'course_tier' => 'Course Tier',
            'is_public' => 'Is Public',
            'is_examine' => 'Is Examine',
            'create_by' => 'Create By',
            'create_time' => 'Create Time',
            'update_by' => 'Update By',
            'update_time' => 'Update Time',
            'del_flag' => 'Del Flag',
            'project_id' => 'Project ID',
        ];
    }
}
